package com.health.auth.customImpl;

import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;

import java.util.Collection;
import java.util.Properties;

public class HealthyInMemoryUserDetailsManager extends InMemoryUserDetailsManager {

    public HealthyInMemoryUserDetailsManager() {
        super();
    }

    // 重写这个方法试试
    public HealthyInMemoryUserDetailsManager(Collection<HealthyUser> users) {
        for (HealthyUser user : users) {
            createUser(user);
        }
    }

    public HealthyInMemoryUserDetailsManager(UserDetails... users) {
        super(users);
    }

    public HealthyInMemoryUserDetailsManager(Properties users) {
        super(users);
    }

    @Override
    public void createUser(UserDetails user) {
        super.createUser(user);
    }

    @Override
    public void deleteUser(String username) {
        super.deleteUser(username);
    }

    @Override
    public void updateUser(UserDetails user) {
        super.updateUser(user);
    }

    @Override
    public boolean userExists(String username) {
        return super.userExists(username);
    }

    @Override
    public void changePassword(String oldPassword, String newPassword) {
        super.changePassword(oldPassword, newPassword);
    }

    @Override
    public UserDetails updatePassword(UserDetails user, String newPassword) {
        return super.updatePassword(user, newPassword);
    }

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return super.loadUserByUsername(username);
    }

    @Override
    public void setAuthenticationManager(AuthenticationManager authenticationManager) {
        super.setAuthenticationManager(authenticationManager);
    }

}
